LoginManager = {

		
		onLoginFormSubmitEventHandler: function(event){
			var loginFormParams = $(event.target).serialize();
			LoginManager.loginUrl =  $(event.target).attr("action");
			LoginManager.processLogin(loginFormParams);
			return false;
		},
		
		initialize: function(){
			$("#dropdownLoginForm").bind('submit', this.onLoginFormSubmitEventHandler);
		},
		
		processLogin : function(loginData){
			$.ajax(this.loginUrl, {
				type : 'POST',
				data : loginData,
				dataType: 'json',
				success : this.onLoginSuccessEventHandler,
				error : this.onLoginErrorEventHandler
			});
		},
		
		onLoginSuccessEventHandler : function(response)
		{
			window.location.replace(contextPath + '/');
		},

		onLoginErrorEventHandler : function(response)
		{
			$('#headerUserLoginError').show();
			$('#userLoginError').show();
		},
};